*************************************************************************************
** 	Replication for 
**
** 	The Risks of Election Observation: International Condemnation and Post-Election Violence
** 	Inken von Borzyskowski
**  International Studies Quarterley
** 
**	Created: 11 December 2018
**
*************************************************************************************

clear
estimates clear 
set more off
* set working directory
use "Condemnation.dta", clear

// install if you have not yet:
* ssc install estout
* ssc install texsave
* ssc install cem
* net from https://gking.harvard.edu/clarify/
* net install clarify
* net install gr0002_3, from(http://www.stata-journal.com/software/sj4-3)







***********************************
* Figure 1
***********************************

// Figure 1a
use "Condemnation.dta", clear
keep if observedW46==1

egen percent = mean(100 * PostElViolence), by(NegReport)
replace percent =round(percent,.1)
egen total = sum(1), by(NegReport)
twoway bar percent NegReport, ///
	barw(0.5) legend(off) ytitle(Rate of Post-Election Violence) /// 
	xtitle("") scheme(lean2) ///
	xlabel(0 "No Condemnation" 1 "Condemnation") ///
	plotregion(margin(b = 0)) || scatter percent NegReport,  ///
	mlabel(percent) mlabsize(medium) mlabpos(12) ms(none) legend(off) 
graph save Figure1a, replace

// Figure 1b
use "Condemnation.dta", clear
keep if observedW46==1

keep if SeriousFraud ==1 
egen percentf = mean(100 * PostElViolence) , by(NegReport)
replace percentf =round(percentf,.1)
egen totalf = sum(1) , by(NegReport)
twoway bar percentf NegReport, ///
	barw(0.5) legend(off) ytitle(Rate of Post-Election Violence) ///
	xtitle("") scheme(lean2) ///
	xlabel(0 `""No Condemnation," "Serious fraud""' 1 `""Condemnation," "Serious fraud""', tlength(0)) ///
	plotregion(margin(b = 0)) || scatter percentf NegReport,  ///
	mlabel(percentf) mlabsize(medium) mlabpos(12) ms(none) legend(off) 
graph save Figure1b, replace

// Figure 1c
use "Condemnation.dta", clear
keep if observedW46==1

keep if SeriousFraud ==0
egen percentnf = mean(100 * PostElViolence) , by(NegReport)
replace percentnf =round(percentnf,.1)
egen totalnf = sum(1) , by(NegReport)
twoway bar percentnf NegReport, ///
	barw(0.5) legend(off) ytitle(Rate of Post-Election Violence) ///
	xtitle("") scheme(lean2) ///
	xlabel(0 `""No Condemnation," "No serious fraud""' 1 `""Condemnation," "No serious fraud""', tlength(0)) ///
	plotregion(margin(b = 0)) || scatter percentnf NegReport, ///
	mlabel(percentnf) mlabsize(medium)  mlabpos(12) ms(none) legend(off) 	
graph save Figure1c, replace

graph combine Figure1A.gph  Figure1C.gph Figure1b.gph, ///
	ycommon scheme(lean2) plotregion (margin(b = 0)) holes(2)
graph export Figure1.pdf, replace



***********************************
* Table 1
***********************************
use "Condemnation.dta", clear

set more off
local controls LoserVoteShare Boycott type3 previolev DPI_yrsoffc_Lag1Log ///
	Prio_CWPast10 WB_GDPpc_Lag1Log  Ross_oilgas_valuePOP2000_Lag1Log ///
	P_xconst_Lag1 WB_PopM_Lag1Log Finkel_EF_Lag1

logit PostElViolence NegReport SeriousFraud  				observedW46 `controls' , vce (cluster cowcode)  	 	
est store Table1m1
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit PostElViolence NegReport Kelley_SeriousFraudorig   	observedW46 `controls' , vce (cluster cowcode)  	 	
est store Table1m2
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit PostElViolence NegReport Kelley_QED_SR21CHEAT   		observedW46 `controls' , vce (cluster cowcode)  	 	
est store Table1m3
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit PostElViolence NegReport SeriousFraud  				`controls' if observedW46 ==1, vce (cluster cowcode) 	 	
est store Table1m4
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit PostElViolence NegReport Kelley_SeriousFraudorig   	`controls' if observedW46 ==1, vce (cluster cowcode) 	 	
est store Table1m5
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit PostElViolence NegReport Kelley_QED_SR21CHEAT   		`controls' if observedW46 ==1,vce (cluster cowcode) 	  	
est store Table1m6
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)
	
estout Table1m* using Table1.tex, ///
	replace style(tex) eqlabels(none)  label cells(b(fmt(%9.3f) star) ///
	se(par fmt(%9.3f))) stats(N N_clust class lroc R2 aic bic ll, fmt(0 0 2 2 2) ///
	label( "Observations" "Number of countries"  "Percent correctly classified" "ROC" "Pseudo R2" "AIC" "BIC" "LL")) ///
	starlevels(* .1 ** .05 *** .01) ///
	order (NegReport observedW46 ///
	SeriousFraud Kelley_SeriousFraudorig Kelley_QED_SR21CHEAT ) 



***********************************
* Figure 2 estimates
***********************************
use "Condemnation.dta", clear

set seed 54321

set more off
local controls LoserVoteShare Boycott type3 previolev DPI_yrsoffc_Lag1Log ///
	Prio_CWPast10 WB_GDPpc_Lag1Log  Ross_oilgas_valuePOP2000_Lag1Log ///
	P_xconst_Lag1 WB_PopM_Lag1Log Finkel_EF_Lag1

estsimp logit PostElViolence NegReport SeriousFraud observedW46 `controls' , ///
	vce (cluster cowcode) sims(1000)
setx NegReport 0 SeriousFraud 0 observedW46 1 ///
	LoserVoteShare 22.885 Boycott 0 type3 1 previolev 1 DPI_yrsoffc_Lag1Log 1.952 ///
	Prio_CWPast10 0 WB_GDPpc_Lag1Log 6.114 Ross_oilgas_valuePOP2000_Lag1Log -5.337 ///
	P_xconst_Lag1  3.00  WB_PopM_Lag1Log  2.009 Finkel_EF_Lag1 0.679 
simqi
* Pr(PostElViolence=1) |   .0158698     .0188866     .0015626    .0683706

setx NegReport 1 
simqi
* Pr(PostElViolence=1) |   .1909332     .1238674     .0352637    .4998722

setx NegReport 0 SeriousFraud 1
simqi
* Pr(PostElViolence=1) |   .0681363     .0444732     .0166228    .1908475

setx NegReport 1 SeriousFraud 1
simqi
*  Pr(PostElViolence=1) |   .5348327      .158626     .2045016    .8123026



***********************************
* Figure 2 graph - see R code
***********************************











**********************************************************************
**********************  APPENDIX MATERIAL  ***************************
**********************************************************************


***********************************
* Appendix Table A1
***********************************
use "Condemnation.dta", clear

* generate propensity score
logit NegReport previolev SeriousFraud WB_GDPpc_Lag1Log ///
	WB_ODAPCconstant_Lag1Log FirstMultiParty Lindberg_Turnover if observedW46 ==1, ///
	cluster(cowcode)
predict propensity if observedW46 ==1
sum propensity
label var propensity "Propensity score"

set more off
sutex PostElViolence LoserChallenge NegReport ///
	OtherVerdicts propensity ///
	ConflictingReports  ConflictingReportsANY ///
	observedW46 observedANY45 ///
	PreElectionConcerns Kelley_QED_SA1 SeriousFraud ///
	Kelley_SeriousFraudorig Kelley_QED_SR21CHEAT Kelley_QED_SR11CHEAT ///
	LoserVoteShare Boycott type3 previolev ///
	DPI_yrsoffc_Lag1Log Prio_CWPast10 WB_GDPpc_Lag1Log  ///
	Ross_oilgas_valuePOP2000_Lag1Log P_xconst_Lag1 WB_PopM_Lag1Log ///
	Finkel_EF_Lag1, minmax label digits(3) file(AppendixTableA1.tex) replace


	
***********************************
* Appendix page 2 / Manuscript footnote 42
***********************************
use "Condemnation.dta", clear

set more off
local controls LoserVoteShare Boycott type3 previolev DPI_yrsoffc_Lag1Log ///
	Prio_CWPast10 WB_GDPpc_Lag1Log  Ross_oilgas_valuePOP2000_Lag1Log ///
	P_xconst_Lag1 WB_PopM_Lag1Log Finkel_EF_Lag1
logit PostElViolence NegReport OtherVerdicts SeriousFraud  				`controls' , vce (cluster cowcode)  	 	
ttest NegReport==OtherVerdicts
logit PostElViolence NegReport OtherVerdicts Kelley_SeriousFraudorig  	`controls' , vce (cluster cowcode)  	 	
ttest NegReport==OtherVerdicts
logit PostElViolence NegReport OtherVerdicts Kelley_QED_SR21CHEAT   	`controls' , vce (cluster cowcode)  	 	
ttest NegReport==OtherVerdicts
	
	
	
***********************************
* Appendix Table A2
***********************************
use "Condemnation.dta", clear

set more off
local controls LoserVoteShare Boycott type3 previolev DPI_yrsoffc_Lag1Log ///
	Prio_CWPast10 WB_GDPpc_Lag1Log  Ross_oilgas_valuePOP2000_Lag1Log ///
	P_xconst_Lag1 WB_PopM_Lag1Log Finkel_EF_Lag1

logit LoserChallenge NegReport SeriousFraud  observedW46			`controls' , cluster(cowcode) 	 	
est store TableA2m1
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit LoserChallenge NegReport Kelley_SeriousFraudorig  observedW46	`controls' , cluster(cowcode) 	 	
est store TableA2m2
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit LoserChallenge NegReport Kelley_QED_SR21CHEAT observedW46		`controls' , cluster(cowcode) 	 	
est store TableA2m3
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit LoserChallenge NegReport SeriousFraud   						`controls' if observedW46 ==1, cluster(cowcode) asis 	  	
est store TableA2m4
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit LoserChallenge NegReport Kelley_SeriousFraudorig   			`controls' if observedW46 ==1, cluster(cowcode) 	asis   	
est store TableA2m5
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit LoserChallenge NegReport Kelley_QED_SR21CHEAT   				`controls' if observedW46 ==1, cluster(cowcode) 	asis  	
est store TableA2m6
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

estout TableA2m* using AppendixTableA2.tex, ///
	replace style(tex) eqlabels(none)  label cells(b(fmt(%9.3f) star) ///
	se(par fmt(%9.3f))) stats(N N_clust class lroc R2 aic bic ll, fmt(0 0 2 2 2) ///
	label( "Observations" "Number of countries"  "Percent correctly classified" "ROC" "Pseudo R2" "AIC" "BIC" "LL")) ///
	starlevels(* .1 ** .05 *** .01) ///
	order (NegReport observedW46 ///
	SeriousFraud Kelley_SeriousFraudorig Kelley_QED_SR21CHEAT ) 

	

***********************************
* Appendix Table A3
***********************************
use "Condemnation.dta", clear

set more off
local controls LoserVoteShare Boycott type3 previolev DPI_yrsoffc_Lag1Log ///
	Prio_CWPast10 WB_GDPpc_Lag1Log  Ross_oilgas_valuePOP2000_Lag1Log ///
	P_xconst_Lag1 WB_PopM_Lag1Log Finkel_EF_Lag1

logit PostElViolence LoserChallenge	  			 observedW46 `controls', cluster(cowcode) asis		
est store TableA3m1
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit PostElViolence LoserChallenge	 SeriousFraud observedW46 `controls', cluster(cowcode) asis		
est store TableA3m2
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit PostElViolence LoserChallenge				 `controls' if observedW46==1, cluster(cowcode) asis		
est store TableA3m3
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit PostElViolence LoserChallenge	SeriousFraud `controls' if observedW46==1, cluster(cowcode) asis		
est store TableA3m4
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

estout TableA3m* using AppendixTableA3.tex, ///
	replace style(tex) eqlabels(none)  label cells(b(fmt(%9.3f) star) ///
	se(par fmt(%9.3f))) stats(N N_clust class lroc R2 aic bic ll, fmt(0 0 2 2 2) ///
	label( "Observations" "Number of countries"  "Percent correctly classified" "ROC" "Pseudo R2" "AIC" "BIC" "LL")) ///
	starlevels(* .1 ** .05 *** .01) ///
	order (LoserChallenge observedW46 ) 



***********************************
* Appendix Table A4
***********************************
use "Condemnation.dta", clear

set more off
local controls LoserVoteShare Boycott type3 previolev DPI_yrsoffc_Lag1Log ///
	Prio_CWPast10 WB_GDPpc_Lag1Log  Ross_oilgas_valuePOP2000_Lag1Log ///
	P_xconst_Lag1 WB_PopM_Lag1Log Finkel_EF_Lag1
reg SCAD NegReport SeriousFraud  			observedW46 `controls' , vce (cluster cowcode)  	 	
est store TableA4m1
reg SCAD NegReport Kelley_SeriousFraudorig  observedW46 `controls' , vce (cluster cowcode)  	   
est store TableA4m2
reg SCAD NegReport Kelley_QED_SR21CHEAT   	observedW46 `controls' , vce (cluster cowcode)  	 	  
est store TableA4m3
reg SCAD NegReport SeriousFraud  			`controls' if observedW46 ==1, vce (cluster cowcode) 	 	
est store TableA4m4
reg SCAD NegReport Kelley_SeriousFraudorig  `controls' if observedW46 ==1, vce (cluster cowcode) 	   	
est store TableA4m5
reg SCAD NegReport Kelley_QED_SR21CHEAT   	`controls' if observedW46 ==1,vce (cluster cowcode) 	    	
est store TableA4m6

estout TableA4m* using AppendixTableA4.tex, ///
	replace style(tex) eqlabels(none)  label cells(b(fmt(%9.3f) star) ///
	se(par fmt(%9.3f))) stats(N N_clust aic bic ll, fmt(0 0 2 2 2) ///
	label( "Observations" "Number of countries" "AIC" "BIC" "LL")) ///
	starlevels(* .1 ** .05 *** .01) ///
	order (NegReport observedW46 SeriousFraud ///
	Kelley_SeriousFraudorig Kelley_QED_SR21CHEAT ) 

	
	
***********************************
* Appendix Table A5
***********************************
use "Condemnation.dta", clear

set more off
local controls LoserVoteShare Boycott type3 previolev DPI_yrsoffc_Lag1Log ///
	Prio_CWPast10 WB_GDPpc_Lag1Log  Ross_oilgas_valuePOP2000_Lag1Log ///
	P_xconst_Lag1 WB_PopM_Lag1Log Finkel_EF_Lag1
reg ACLED NegReport SeriousFraud  			observedW46 `controls' , vce (cluster cowcode)  	 	
est store TableA5m1
reg ACLED NegReport Kelley_SeriousFraudorig observedW46 `controls' , vce (cluster cowcode)  	   
est store TableA5m2
reg ACLED NegReport Kelley_QED_SR21CHEAT	observedW46 `controls' , vce (cluster cowcode)  	 	  
est store TableA5m3
reg ACLED NegReport SeriousFraud  			`controls' if observedW46 ==1, vce (cluster cowcode) 	 	
est store TableA5m4
reg ACLED NegReport Kelley_SeriousFraudorig `controls' if observedW46 ==1, vce (cluster cowcode) 	   	
est store TableA5m5
reg ACLED NegReport Kelley_QED_SR21CHEAT    `controls' if observedW46 ==1,vce (cluster cowcode) 	    	
est store TableA5m6

estout TableA5m* using AppendixTableA5.tex, ///
	replace style(tex) eqlabels(none)  label cells(b(fmt(%9.3f) star) ///
	se(par fmt(%9.3f))) stats(N N_clust aic bic ll, fmt(0 0 2 2 2) ///
	label( "Observations" "Number of countries" "AIC" "BIC" "LL")) ///
	starlevels(* .1 ** .05 *** .01) ///
	order (NegReport observedW46 ///
	SeriousFraud Kelley_SeriousFraudorig Kelley_QED_SR21CHEAT ) 


	
***********************************
* Appendix Table A6
***********************************
use "Condemnation.dta", clear

set more off
local controls LoserVoteShare Boycott type3 previolev DPI_yrsoffc_Lag1Log ///
	Prio_CWPast10 WB_GDPpc_Lag1Log  Ross_oilgas_valuePOP2000_Lag1Log ///
	P_xconst_Lag1 WB_PopM_Lag1Log Finkel_EF_Lag1

logit PostElViolence NegReport ConflictingReports SeriousFraud   			observedW46 `controls' , vce (cluster cowcode)  	 	
est store TableA6m1
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit PostElViolence NegReport ConflictingReports Kelley_SeriousFraudorig   observedW46 `controls' , vce (cluster cowcode)  	 	
est store TableA6m2
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit PostElViolence NegReport ConflictingReports Kelley_QED_SR21CHEAT   	observedW46 `controls' , vce (cluster cowcode)  	 	
est store TableA6m3
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit PostElViolence NegReport ConflictingReports SeriousFraud  			`controls' if observedW46 ==1, cluster(cowcode) 	 	
est store TableA6m4
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit PostElViolence NegReport ConflictingReports Kelley_SeriousFraudorig  	`controls' if observedW46 ==1, cluster(cowcode) 	 	
est store TableA6m5
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit PostElViolence NegReport ConflictingReports Kelley_QED_SR21CHEAT   	`controls' if observedW46 ==1, cluster(cowcode) 	  	
est store TableA6m6
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

estout TableA6m* using AppendixTableA6.tex, ///
	replace style(tex) eqlabels(none)  label cells(b(fmt(%9.3f) star) ///
	se(par fmt(%9.3f))) stats(N N_clust class lroc R2 aic bic ll, fmt(0 0 2 2 2) ///
	label( "Observations" "Number of countries"  "Percent correctly classified" "ROC" "Pseudo R2" "AIC" "BIC" "LL")) ///
	starlevels(* .1 ** .05 *** .01) ///
	order (NegReport ConflictingReports observedW46 ///
	SeriousFraud Kelley_SeriousFraudorig Kelley_QED_SR21CHEAT ) 


	
***********************************
* Appendix Table A7
***********************************
use "Condemnation.dta", clear

set more off
local controls LoserVoteShare Boycott type3 previolev DPI_yrsoffc_Lag1Log ///
	Prio_CWPast10 WB_GDPpc_Lag1Log  Ross_oilgas_valuePOP2000_Lag1Log ///
	P_xconst_Lag1 WB_PopM_Lag1Log Finkel_EF_Lag1

logit PostElViolence NegReport ConflictingReportsANY SeriousFraud   			observedANY45 `controls' , vce (cluster cowcode)  	 	
est store TableA7m1
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit PostElViolence NegReport ConflictingReportsANY Kelley_SeriousFraudorig   	observedANY45 `controls' , vce (cluster cowcode)  	 	
est store TableA7m2
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit PostElViolence NegReport ConflictingReportsANY Kelley_QED_SR21CHEAT   	observedANY45 `controls' , vce (cluster cowcode)  	 	
est store TableA7m3
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)
	
logit PostElViolence NegReport ConflictingReportsANY SeriousFraud  				`controls' if observedANY45 ==1, cluster(cowcode) 	 	
est store TableA7m4
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit PostElViolence NegReport ConflictingReportsANY Kelley_SeriousFraudorig  	`controls' if observedANY45 ==1, cluster(cowcode) 	 	
est store TableA7m5
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit PostElViolence NegReport ConflictingReportsANY Kelley_QED_SR21CHEAT   	`controls' if observedANY45 ==1, cluster(cowcode) 	  	
est store TableA7m6
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

estout TableA7m* using AppendixTableA7.tex, ///
	replace style(tex) eqlabels(none)  label cells(b(fmt(%9.3f) star) ///
	se(par fmt(%9.3f))) stats(N N_clust class lroc R2 aic bic ll, fmt(0 0 2 2 2) ///
	label( "Observations" "Number of countries"  "Percent correctly classified" "ROC" "Pseudo R2" "AIC" "BIC" "LL")) ///
	starlevels(* .1 ** .05 *** .01) ///
	order (NegReport ConflictingReportsANY observedANY45 ///
	SeriousFraud Kelley_SeriousFraudorig Kelley_QED_SR21CHEAT ) 



***********************************
* Appendix Table A8
***********************************
use "Condemnation.dta", clear

set more off
local controls LoserVoteShare Boycott type3 previolev DPI_yrsoffc_Lag1Log ///
	Prio_CWPast10 WB_GDPpc_Lag1Log  Ross_oilgas_valuePOP2000_Lag1Log ///
	P_xconst_Lag1 WB_PopM_Lag1Log Finkel_EF_Lag1

logit PostElViolence NegReportAll  MixedReport  SeriousFraud   				observedW46 `controls' , vce (cluster cowcode)  	 	
est store TableA8m1
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit PostElViolence NegReportAll  MixedReport    Kelley_SeriousFraudorig  	observedW46 `controls' , vce (cluster cowcode)  	 	
est store TableA8m2
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit PostElViolence NegReportAll  MixedReport    Kelley_QED_SR21CHEAT   	observedW46 `controls' , vce (cluster cowcode)  	 	
est store TableA8m3
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit PostElViolence NegReportAll  MixedReport    SeriousFraud  			`controls' if observedW46 ==1, cluster(cowcode) 	 	
est store TableA8m4
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit PostElViolence NegReportAll  MixedReport    Kelley_SeriousFraudorig  	`controls' if observedW46 ==1, cluster(cowcode) 	 	
est store TableA8m5
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit PostElViolence NegReportAll  MixedReport    Kelley_QED_SR21CHEAT   	`controls' if observedW46 ==1, cluster(cowcode) 	  	
est store TableA8m6
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

estout TableA8m* using AppendixTableA8.tex, ///
	replace style(tex) eqlabels(none)  label cells(b(fmt(%9.3f) star) ///
	se(par fmt(%9.3f))) stats(N N_clust class lroc R2 aic bic ll, fmt(0 0 2 2 2) ///
	label( "Observations" "Number of countries"  "Percent correctly classified" "ROC" "Pseudo R2" "AIC" "BIC" "LL")) ///
	starlevels(* .1 ** .05 *** .01) ///
	order (NegReportAll  MixedReport observedW46 ///
	SeriousFraud Kelley_SeriousFraudorig Kelley_QED_SR21CHEAT ) 

	

***********************************
* Appendix Table A9
***********************************
use "Condemnation.dta", clear

set more off
local controls LoserVoteShare Boycott type3 previolev DPI_yrsoffc_Lag1Log ///
	Prio_CWPast10 WB_GDPpc_Lag1Log  Ross_oilgas_valuePOP2000_Lag1Log ///
	P_xconst_Lag1 WB_PopM_Lag1Log Finkel_EF_Lag1

logit PostElViolence NegReport 							observedW46 `controls' , vce (cluster cowcode)  	 	
est store TableA9m1
estadd scalar R2 = e(r2_p)	
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit PostElViolence NegReport PreElectionConcerns  	observedW46 `controls' , vce (cluster cowcode)  	 	
est store TableA9m2
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit PostElViolence NegReport Kelley_QED_SA1   		observedW46 `controls' , vce (cluster cowcode)  	 	
est store TableA9m3
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit PostElViolence NegReport SeriousFraud   			observedW46 `controls' , vce (cluster cowcode)  	 	
est store TableA9m4
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit PostElViolence NegReport Kelley_SeriousFraudorig 	observedW46 `controls' , vce (cluster cowcode)  	 	
est store TableA9m5
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit PostElViolence NegReport Kelley_QED_SR21CHEAT   	observedW46 `controls' , vce (cluster cowcode)  	 	
est store TableA9m6
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit PostElViolence NegReport Kelley_QED_SR11CHEAT   	observedW46 `controls' , vce (cluster cowcode)  	 	
est store TableA9m7
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit PostElViolence NegReport Kelley_QED_SR21CHEAT Kelley_QED_SR11CHEAT   observedW46 `controls' , vce (cluster cowcode) 	 	
est store TableA9m8
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

estout TableA9m* using AppendixTableA9.tex, ///
	replace style(tex) eqlabels(none)  label cells(b(fmt(%9.3f) star) ///
	se(par fmt(%9.3f))) stats(N N_clust class lroc R2 aic bic ll, fmt(0 0 2 2 2) ///
	label( "Observations" "Number of countries"  "Percent correctly classified" "ROC" "Pseudo R2" "AIC" "BIC" "LL")) ///
	starlevels(* .1 ** .05 *** .01) ///
	order (NegReport observedW46 ///
	PreElectionConcerns Kelley_QED_SA1 SeriousFraud ///
	Kelley_SeriousFraudorig Kelley_QED_SR21CHEAT Kelley_QED_SR11CHEAT ) 



***********************************
* Appendix Table A10
***********************************
use "Condemnation.dta", clear

set more off
local controls LoserVoteShare Boycott type3 previolev DPI_yrsoffc_Lag1Log ///
	Prio_CWPast10 WB_GDPpc_Lag1Log  Ross_oilgas_valuePOP2000_Lag1Log ///
	P_xconst_Lag1 WB_PopM_Lag1Log Finkel_EF_Lag1

logit PostElViolence NegReport 						`controls' if observedW46 ==1, vce (cluster cowcode)  	 	
est store TableA10m1
estadd scalar R2 = e(r2_p)	
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit PostElViolence NegReport PreElectionConcerns  `controls' if observedW46 ==1, vce (cluster cowcode)  	 	
est store TableA10m2
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit PostElViolence NegReport Kelley_QED_SA1   	`controls' if observedW46 ==1, vce (cluster cowcode)  	 	
est store TableA10m3
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit PostElViolence NegReport SeriousFraud    		`controls' if observedW46 ==1, vce (cluster cowcode)  	 	
est store TableA10m4
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit PostElViolence NegReport Kelley_SeriousFraudorig  `controls' if observedW46 ==1, vce (cluster cowcode)  	 	
est store TableA10m5
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit PostElViolence NegReport Kelley_QED_SR21CHEAT 	`controls' if observedW46 ==1, vce (cluster cowcode)  	 	
est store TableA10m6
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit PostElViolence NegReport Kelley_QED_SR11CHEAT   	 `controls' if observedW46 ==1, vce (cluster cowcode)  	 	
est store TableA10m7
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit PostElViolence NegReport Kelley_QED_SR21CHEAT Kelley_QED_SR11CHEAT   `controls' if observedW46 ==1, vce (cluster cowcode) 	 	
est store TableA10m8
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

estout TableA10m* using AppendixTableA10.tex, ///
	replace style(tex) eqlabels(none)  label cells(b(fmt(%9.3f) star) ///
	se(par fmt(%9.3f))) stats(N N_clust class lroc R2 aic bic ll, fmt(0 0 2 2 2) ///
	label( "Observations" "Number of countries"  "Percent correctly classified" "ROC" "Pseudo R2" "AIC" "BIC" "LL")) ///
	starlevels(* .1 ** .05 *** .01) ///
	order (NegReport  ///
	PreElectionConcerns Kelley_QED_SA1 SeriousFraud ///
	Kelley_SeriousFraudorig Kelley_QED_SR21CHEAT Kelley_QED_SR11CHEAT ) 



***********************************
* Appendix Table A11
***********************************
use "Condemnation.dta", clear

set more off
local controls LoserVoteShare Boycott type3 previolev DPI_yrsoffc_Lag1Log Prio_CWPast10 WB_GDPpc_Lag1Log  Ross_oilgas_valuePOP2000_Lag1Log P_xconst_Lag1 ///
	WB_PopM_Lag1Log Finkel_EF_Lag1
local controls_Sel OppoCompetition PreviousANYElobservedW46 WB_GDPM_Lag1Log WB_GDPpc_Lag1Log year

heckprob PostElViolence NegReport SeriousFraud  `controls' , ///
	select(observedW46 = 	`controls_Sel' ) vce(cluster cowcode) difficult technique (bfgs)
estimates store TableA11m1
estadd scalar ProbRho = e(p_c)

heckprob PostElViolence NegReport SeriousFraud  `controls' , ///
	select(observedW46 =  `controls_Sel' previousELsuspended FirstMultiParty TransitionalGovmt ) vce(cluster cowcode) 
estimates store TableA11m2
estadd scalar ProbRho = e(p_c)

heckprob PostElViolence NegReport SeriousFraud  `controls' , ///
	select(observedW46 =  PreviousANYElobservedW46 UncertainElection WB_GDPM_Lag1Log WB_GDPpc_Lag1Log year) vce(cluster cowcode) difficult technique (bfgs)
estimates store TableA11m3
estadd scalar ProbRho = e(p_c)

heckprob PostElViolence NegReport SeriousFraud  `controls' , ///
	select(observedW46 =  PreviousANYElobservedW46 UncertainElection Finkel_MilAssistPerc_Lag1 DGAidofODA WB_GDPM_Lag1Log WB_GDPpc_Lag1Log year) vce(cluster cowcode) difficult technique (bfgs)
estimates store TableA11m4
estadd scalar ProbRho = e(p_c)

estout TableA11m* using AppendixTableA11.tex, ///
	replace style(tex) eqlabels(none)  label cells(b(fmt(%9.3f) star) ///
	se(par fmt(%9.3f))) stats(ProbRho N N_clust aic bic ll, fmt(2 0 0 2 2 2) ///
	label("Pr(rho)" "Observations" "Clusters" "AIC" "BIC" "LL")) ///
	starlevels(* .1 ** .05 *** .01) drop (OppoCompetition) ///
	order (NegReport SeriousFraud ///
	LoserVoteShare Boycott type3 previolev ///
	DPI_yrsoffc_Lag1Log Prio_CWPast10 WB_GDPpc_Lag1Log  ///
	Ross_oilgas_valuePOP2000_Lag1Log P_xconst_Lag1 WB_PopM_Lag1Log Finkel_EF_Lag1 ///
	PreviousANYElobservedW46 previousELsuspended FirstMultiParty ///
	TransitionalGovmt UncertainElection ///
	Finkel_MilAssistPerc_Lag1 DGAidofODA WB_GDPM_Lag1Log WB_GDPpc_Lag1Log year) 

	

***********************************
* Appendix Table A12
***********************************
use "Condemnation.dta", clear

// columns 1-4
* first stage with set 1 predictors
* excluded bc NOT known before el: LoserVoteShare Boycott previolev
set more off
local controlsSel1 type3 DPI_yrsoffc_Lag1Log ///
	Prio_CWPast10 WB_GDPpc_Lag1Log  Ross_oilgas_valuePOP2000_Lag1Log ///
	P_xconst_Lag1 WB_PopM_Lag1Log Finkel_EF_Lag1
logit PostElViolence  `controlsSel1' , cluster(cowcode) 
predict yhat
label var yhat "Predicted post-election violence"

* second stage including yhats 
logit observedW46  yhat   	PreviousANYElobservedW46  OppoCompetition WB_GDPpc_Lag1Log WB_GDPM_Lag1Log year, robust cluster(cowcode) 
est store TableA12m1
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit observedW46  yhat   	PreviousANYElobservedW46  OppoCompetition previousELsuspended FirstMultiParty TransitionalGovmt	WB_GDPM_Lag1Log WB_GDPpc_Lag1Log year, robust cluster(cowcode) 
est store TableA12m2
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit observedW46  yhat   	PreviousANYElobservedW46  OppoCompetition UncertainElection WB_GDPpc_Lag1Log year, robust cluster(cowcode) 
est store TableA12m3
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit observedW46  yhat   	PreviousANYElobservedW46 OppoCompetition UncertainElection Finkel_MilAssistPerc_Lag1 DGAidofODA 	WB_GDPM_Lag1Log		WB_GDPpc_Lag1Log year, robust cluster(cowcode) 
est store TableA12m4
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)


// columns 5-8
* first stage with set 2 predictors
drop yhat
set more off
local controlsSel2 type3 Boycott previolev Kelley_QED_SR11CHEAT ///
	DPI_yrsoffc_Lag1Log ///
	Prio_CWPast10 WB_GDPpc_Lag1Log  Ross_oilgas_valuePOP2000_Lag1Log ///
	P_xconst_Lag1 WB_PopM_Lag1Log Finkel_EF_Lag1
logit PostElViolence  `controlsSel2' , cluster(cowcode) 
predict yhat

* second stage including yhats 
logit observedW46  yhat   	PreviousANYElobservedW46  OppoCompetition WB_GDPpc_Lag1Log WB_GDPM_Lag1Log year, robust cluster(cowcode) 
est store TableA12m5
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit observedW46  yhat   	PreviousANYElobservedW46  OppoCompetition previousELsuspended FirstMultiParty TransitionalGovmt	WB_GDPM_Lag1Log WB_GDPpc_Lag1Log year, robust cluster(cowcode) 
est store TableA12m6
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit observedW46  yhat   	PreviousANYElobservedW46  OppoCompetition UncertainElection WB_GDPpc_Lag1Log year, robust cluster(cowcode) 
est store TableA12m7
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit observedW46  yhat   	PreviousANYElobservedW46 OppoCompetition UncertainElection Finkel_MilAssistPerc_Lag1 DGAidofODA 	WB_GDPM_Lag1Log		WB_GDPpc_Lag1Log year, robust cluster(cowcode) 
est store TableA12m8
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)


// columns 9-12
* first stage with set 1 predictors
drop yhat
set more off
local controlsSel1 type3 DPI_yrsoffc_Lag1Log ///
	Prio_CWPast10 WB_GDPpc_Lag1Log  Ross_oilgas_valuePOP2000_Lag1Log ///
	P_xconst_Lag1 WB_PopM_Lag1Log Finkel_EF_Lag1
logit PostElViolence  `controlsSel1' , cluster(cowcode) 
predict yhat
label var yhat "Predicted post-election violence"

* second stage including yhats + previolev
logit observedW46  yhat   	PreviousANYElobservedW46  previolev OppoCompetition  WB_GDPpc_Lag1Log WB_GDPM_Lag1Log year, robust cluster(cowcode) 
est store TableA12m9
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit observedW46  yhat   	PreviousANYElobservedW46  previolev OppoCompetition  previousELsuspended FirstMultiParty TransitionalGovmt	WB_GDPM_Lag1Log WB_GDPpc_Lag1Log year, robust cluster(cowcode) 
est store TableA12m10
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit observedW46  yhat   	PreviousANYElobservedW46  previolev OppoCompetition UncertainElection WB_GDPpc_Lag1Log year, robust cluster(cowcode) 
est store TableA12m11
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit observedW46  yhat   	PreviousANYElobservedW46 previolev OppoCompetition  UncertainElection Finkel_MilAssistPerc_Lag1 DGAidofODA 	WB_GDPM_Lag1Log	WB_GDPpc_Lag1Log year, robust cluster(cowcode) 
est store TableA12m12
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

estout TableA12m* using AppendixTableA12.tex, ///
	replace style(tex) eqlabels(none)  label cells(b(fmt(%9.3f) star) ///
	se(par fmt(%9.3f))) stats(N N_clust class lroc R2 aic bic ll, fmt(0 0 2 2 2) ///
	label( "Observations" "Number of countries"  "Percent correctly classified" "ROC" "Pseudo R2" "AIC" "BIC" "LL")) ///
	starlevels(* .1 ** .05 *** .01) drop (OppoCompetition) ///
	order (yhat previolev PreviousANYElobservedW46  ///
	previousELsuspended	FirstMultiParty TransitionalGovmt UncertainElection ///
	DGAidofODA Finkel_MilAssistPerc_Lag1 WB_GDPM_Lag1Log WB_GDPpc_Lag1Log year ) 


	
***********************************
* Appendix Table A13
***********************************
use "Condemnation.dta", clear

// columns 1-4
* first stage with set 1 predictors
* excluded bc NOT known before el: LoserVoteShare Boycott previolev
set more off
local controlsSel1 type3 DPI_yrsoffc_Lag1Log ///
	Prio_CWPast10 WB_GDPpc_Lag1Log  Ross_oilgas_valuePOP2000_Lag1Log ///
	P_xconst_Lag1 WB_PopM_Lag1Log Finkel_EF_Lag1
logit PostElViolence  `controlsSel1' , cluster(cowcode) 
predict yhat
label var yhat "Predicted post-election violence"

* second stage including yhats 
logit observedW46Refused  yhat   	PreviousANYElobservedW46  OppoCompetition  WB_GDPpc_Lag1Log WB_GDPM_Lag1Log year, robust cluster(cowcode) 
est store TableA13m1
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit observedW46Refused  yhat   	PreviousANYElobservedW46  OppoCompetition  previousELsuspended	FirstMultiParty TransitionalGovmt WB_GDPM_Lag1Log WB_GDPpc_Lag1Log year, robust cluster(cowcode) 
est store TableA13m2
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit observedW46Refused  yhat   	PreviousANYElobservedW46  OppoCompetition UncertainElection WB_GDPpc_Lag1Log year, robust cluster(cowcode) 
est store TableA13m3
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit observedW46Refused  yhat   	PreviousANYElobservedW46 OppoCompetition  UncertainElection Finkel_MilAssistPerc_Lag1 DGAidofODA WB_GDPM_Lag1Log WB_GDPpc_Lag1Log year, robust cluster(cowcode) 
est store TableA13m4
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

// columns 5-8
* first stage with set 2 predictors
drop yhat
set more off
local controlsSel2 type3 Boycott previolev Kelley_QED_SR11CHEAT ///
	DPI_yrsoffc_Lag1Log ///
	Prio_CWPast10 WB_GDPpc_Lag1Log  Ross_oilgas_valuePOP2000_Lag1Log ///
	P_xconst_Lag1 WB_PopM_Lag1Log Finkel_EF_Lag1
logit PostElViolence  `controlsSel2' , cluster(cowcode) 
predict yhat

* second stage including yhats 
logit observedW46Refused  yhat   	PreviousANYElobservedW46  OppoCompetition  WB_GDPpc_Lag1Log WB_GDPM_Lag1Log year, robust cluster(cowcode) 
est store TableA13m5
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit observedW46Refused  yhat   	PreviousANYElobservedW46  OppoCompetition  previousELsuspended	FirstMultiParty TransitionalGovmt	WB_GDPM_Lag1Log WB_GDPpc_Lag1Log year, robust cluster(cowcode) 
est store TableA13m6
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit observedW46Refused  yhat   	PreviousANYElobservedW46  OppoCompetition UncertainElection WB_GDPpc_Lag1Log year, robust cluster(cowcode) 
est store TableA13m7
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit observedW46Refused  yhat   	PreviousANYElobservedW46 OppoCompetition  UncertainElection Finkel_MilAssistPerc_Lag1 DGAidofODA WB_GDPM_Lag1Log WB_GDPpc_Lag1Log year, robust cluster(cowcode) 
est store TableA13m8
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)


// columns 9-12
* first stage with set 1 predictors
drop yhat
set more off
local controlsSel1 type3 DPI_yrsoffc_Lag1Log ///
	Prio_CWPast10 WB_GDPpc_Lag1Log  Ross_oilgas_valuePOP2000_Lag1Log ///
	P_xconst_Lag1 WB_PopM_Lag1Log Finkel_EF_Lag1
logit PostElViolence  `controlsSel1' , cluster(cowcode) 
predict yhat
label var yhat "Predicted post-election violence"

* second stage including yhats + previolev
logit observedW46Refused  yhat   	PreviousANYElobservedW46  previolev OppoCompetition  WB_GDPpc_Lag1Log WB_GDPM_Lag1Log year, robust cluster(cowcode) 
est store TableA13m9
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit observedW46Refused  yhat   	PreviousANYElobservedW46  previolev OppoCompetition  previousELsuspended FirstMultiParty TransitionalGovmt WB_GDPM_Lag1Log WB_GDPpc_Lag1Log year, robust cluster(cowcode) 
est store TableA13m10
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit observedW46Refused  yhat   	PreviousANYElobservedW46  previolev OppoCompetition UncertainElection WB_GDPpc_Lag1Log year, robust cluster(cowcode) 
est store TableA13m11
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit observedW46Refused  yhat   	PreviousANYElobservedW46 previolev OppoCompetition  UncertainElection Finkel_MilAssistPerc_Lag1 DGAidofODA WB_GDPM_Lag1Log		WB_GDPpc_Lag1Log year, robust cluster(cowcode) 
est store TableA13m12
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

estout TableA13m* using AppendixTableA13.tex, ///
	replace style(tex) eqlabels(none)  label cells(b(fmt(%9.3f) star) ///
	se(par fmt(%9.3f))) stats(N N_clust class lroc R2 aic bic ll, fmt(0 0 2 2 2) ///
	label( "Observations" "Number of countries"  "Percent correctly classified" "ROC" "Pseudo R2" "AIC" "BIC" "LL")) ///
	starlevels(* .1 ** .05 *** .01) drop (OppoCompetition) ///
	order (yhat previolev PreviousANYElobservedW46  ///
	previousELsuspended	FirstMultiParty TransitionalGovmt UncertainElection ///
	DGAidofODA Finkel_MilAssistPerc_Lag1 WB_GDPM_Lag1Log WB_GDPpc_Lag1Log year ) 



***********************************
* Appendix Table A14
***********************************
use "Condemnation.dta", clear
keep if observedW46 ==1

set more off
local controls LoserVoteShare Boycott type3 DPI_yrsoffc_Lag1Log ///
	Prio_CWPast10 WB_GDPpc_Lag1Log  Ross_oilgas_valuePOP2000_Lag1Log ///
	P_xconst_Lag1 WB_PopM_Lag1Log Finkel_EF_Lag1
local predCondemn previolev Kelley_QED_SR11CHEAT Kelley_QED_SR21CHEAT Kelley_QED_SR22CAP WB_ODAPCconstant_Lag1Log FirstMultiParty  
local predCondemn2 previolev SeriousFraud WB_GDPpc_Lag1Log WB_ODAPCconstant_Lag1Log FirstMultiParty

treatreg PostElViolence SeriousFraud  `controls' previolev, treat(NegReport =  `predCondemn2' Lindberg_Turnover) cluster(cowcode) 
est store TableA14m1
estadd scalar exog2 = e(p_c)

treatreg PostElViolence SeriousFraud `controls' previolev, treat(NegReport =  `predCondemn2' Kelley_QED_SELTRANS) cluster(cowcode) 
est store TableA14m2
estadd scalar exog2 = e(p_c)

treatreg PostElViolence SeriousFraud  `controls' previolev, treat(NegReport =  `predCondemn' Lindberg_Turnover) cluster(cowcode) 
est store TableA14m3
estadd scalar exog2 = e(p_c)

treatreg PostElViolence SeriousFraud `controls' previolev , treat(NegReport =  `predCondemn' Kelley_QED_SELTRANS) cluster(cowcode) 
est store TableA14m4
estadd scalar exog2 = e(p_c)

treatreg PostElViolence SeriousFraud  `controls' 			, treat(NegReport =  previolev) cluster(cowcode) 
est store TableA14m5
estadd scalar exog2 = e(p_c)

estout TableA14m* using AppendixTableA14.tex, ///
	replace style(tex) eqlabels(none)  label cells(b(fmt(%9.3f) star) ///
	se(par fmt(%9.3f))) stats(exog2 N N_clust aic bic ll, fmt(2 0 0 2 2 2) ///
	label("p(exogeneity)" "Observations" "Number of countries"  "AIC" "BIC" "LL")) ///
	starlevels(* .1 ** .05 *** .01) ///
	order (NegReport SeriousFraud LoserVoteShare Boycott type3 previolev ///
	DPI_yrsoffc_Lag1Log Prio_CWPast10 WB_GDPpc_Lag1Log Ross_oilgas_valuePOP2000_Lag1Log ///
	P_xconst_Lag1 WB_PopM_Lag1Log Finkel_EF_Lag1 ///
	Kelley_QED_SR11CHEAT Kelley_QED_SR21CHEAT Kelley_QED_SR22CAP ///
	WB_ODAPCconstant_Lag1Log FirstMultiParty Lindberg_Turnover Kelley_QED_SELTRANS) 


	
***********************************
* Appendix Figure A1 - see R code
***********************************



***********************************
* Appendix Figure A2
***********************************
use "FigureA2data.dta", clear 

graph box v2xel_frefair, by(WEuropeNA, note("Note: V-Dem, 1990-2008")) ///
	scheme(lean1) ylab( , nogrid)
graph export FigureA2.pdf, replace





***********************************
* Appendix Table A15 - see R code
***********************************



***********************************
* Appendix Figure A3 - see R code
***********************************



***********************************************
* CEM (referenced on Appendix page 25)
***********************************************
use "Condemnation.dta", clear

keep if observedW46 ==1

foreach varname in PostElViolence NegReport SeriousFraud ///
	LoserVoteShare Boycott type3 previolev ///
	DPI_yrsoffc_Lag1Log Prio_CWPast10 WB_GDPpc_Lag1Log  Ross_oilgas_valuePOP2000_Lag1Log P_xconst_Lag1 ///
	WB_PopM_Lag1Log Finkel_EF_Lag1  {
	drop if `varname'==.
	}	

set more off
cem SeriousFraud(#1) LoserVoteShare (#4) Boycott (#1) type3 (#2) previolev (#3) ///
	DPI_yrsoffc_Lag1Log (#3) Prio_CWPast10 (#1) WB_GDPpc_Lag1Log (#5)  ///
	Ross_oilgas_valuePOP2000_Lag1Log (#2) P_xconst_Lag1 (#1) ///
	WB_PopM_Lag1Log (#2) Finkel_EF_Lag1(#3) ///
	WB_ODAPCconstant_Lag1Log(#4) FirstMultiParty(#1) Lindberg_Turnover(#1), tr(NegReport)
regress PostElViolence NegReport [iweight=cem_weights]

regress PostElViolence NegReport ///
	   Boycott      previolev  ///
	DPI_yrsoffc_Lag1Log       ///
	Ross_oilgas_valuePOP2000_Lag1Log   P_xconst_Lag1   ///
	WB_PopM_Lag1Log   Finkel_EF_Lag1  ///
	WB_ODAPCconstant_Lag1Log FirstMultiParty  ///
	[iweight=cem_weights]

* Replicate with PreElectionConcerns
set more off
cem PreElectionConcerns(#1) LoserVoteShare (#4) Boycott (#1) type3 (#2) previolev (#3) ///
	DPI_yrsoffc_Lag1Log (#3) Prio_CWPast10 (#1) WB_GDPpc_Lag1Log (#5)  ///
	Ross_oilgas_valuePOP2000_Lag1Log (#2) P_xconst_Lag1 (#1) ///
	WB_PopM_Lag1Log (#2) Finkel_EF_Lag1(#3) ///
	WB_ODAPCconstant_Lag1Log(#4) FirstMultiParty(#1) Lindberg_Turnover(#1), tr(NegReport)
regress PostElViolence NegReport [iweight=cem_weights]

regress PostElViolence NegReport ///
	  Boycott      previolev  ///
	DPI_yrsoffc_Lag1Log   ///
	Ross_oilgas_valuePOP2000_Lag1Log   P_xconst_Lag1   ///
	WB_PopM_Lag1Log   Finkel_EF_Lag1  ///
	WB_ODAPCconstant_Lag1Log FirstMultiParty  ///
	[iweight=cem_weights]
	
	
	
***********************************
* Appendix Table A16
***********************************
use "Condemnation.dta", clear
	
sutex IncLost OppoCoalition exclpop_Lag1, ///
	minmax label digits(3) file(AppendixTableA16.tex) replace
	
	
		
***********************************
* Appendix Table A17
***********************************
use "Condemnation.dta", clear
	
set more off
local controls LoserVoteShare type3 previolev DPI_yrsoffc_Lag1Log ///
	Prio_CWPast10 WB_GDPpc_Lag1Log  Ross_oilgas_valuePOP2000_Lag1Log ///
	P_xconst_Lag1 WB_PopM_Lag1Log ///
	IncLost exclpop_Lag1 OppoCoalition

logit PostElViolence NegReport SeriousFraud  			observedW46 `controls' , vce (cluster cowcode)  	 	
est store TableA17m1
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit PostElViolence NegReport Kelley_SeriousFraudorig   observedW46 `controls' , vce (cluster cowcode)  	 	
est store TableA17m2
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit PostElViolence NegReport Kelley_QED_SR21CHEAT   	observedW46 `controls' , vce (cluster cowcode)  	 	
est store TableA17m3
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit PostElViolence NegReport SeriousFraud  			`controls' if observedW46 ==1, vce (cluster cowcode) 	 	
est store TableA17m4
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit PostElViolence NegReport Kelley_SeriousFraudorig   `controls' if observedW46 ==1, vce (cluster cowcode) 	 	
est store TableA17m5
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit PostElViolence NegReport Kelley_QED_SR21CHEAT   	`controls' if observedW46 ==1,vce (cluster cowcode) 	  	
est store TableA17m6
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

estout TableA17m* using AppendixTableA17.tex, ///
	replace style(tex) eqlabels(none)  label cells(b(fmt(%9.3f) star) ///
	se(par fmt(%9.3f))) stats(N N_clust class lroc R2 aic bic ll, fmt(0 0 2 2 2) ///
	label( "Observations" "Number of countries"  "Percent correctly classified" "ROC" "Pseudo R2" "AIC" "BIC" "LL")) ///
	starlevels(* .1 ** .05 *** .01) ///
	order (NegReport observedW46 ///
	SeriousFraud Kelley_SeriousFraudorig Kelley_QED_SR21CHEAT ///
	LoserVoteShare type3 previolev ///
	IncLost OppoCoalition ///
	DPI_yrsoffc_Lag1Log Prio_CWPast10 WB_GDPpc_Lag1Log ///
	Ross_oilgas_valuePOP2000_Lag1Log P_xconst_Lag1 WB_PopM_Lag1Log exclpop_Lag1 ) 


		
***********************************
* Appendix Table A18
***********************************
use "Condemnation.dta", clear
keep if observedW46 ==1

set more off
local controls LoserVoteShare Boycott type3 DPI_yrsoffc_Lag1Log ///
	Prio_CWPast10 WB_GDPpc_Lag1Log  Ross_oilgas_valuePOP2000_Lag1Log ///
	P_xconst_Lag1 WB_PopM_Lag1Log Finkel_EF_Lag1
local predCondemn previolev Kelley_QED_SR11CHEAT Kelley_QED_SR21CHEAT  Kelley_QED_SR22CAP WB_ODAPCconstant_Lag1Log FirstMultiParty IncLost OppoCoalition exclpop_Lag1
local predCondemn2 previolev SeriousFraud 					   WB_GDPpc_Lag1Log   WB_ODAPCconstant_Lag1Log FirstMultiParty IncLost OppoCoalition exclpop_Lag1

treatreg PostElViolence SeriousFraud  `controls' previolev, treat(NegReport =  `predCondemn2' Lindberg_Turnover) cluster(cowcode) 
est store TableA18m1
estadd scalar exog2 = e(p_c)

treatreg PostElViolence SeriousFraud `controls' previolev, treat(NegReport =  `predCondemn2' Kelley_QED_SELTRANS) cluster(cowcode) 
est store TableA18m2
estadd scalar exog2 = e(p_c)

treatreg PostElViolence SeriousFraud  `controls' previolev, treat(NegReport =  `predCondemn' Lindberg_Turnover) cluster(cowcode) 
est store TableA18m3
estadd scalar exog2 = e(p_c)

treatreg PostElViolence SeriousFraud `controls' previolev , treat(NegReport =  `predCondemn' Kelley_QED_SELTRANS) cluster(cowcode) 
est store TableA18m4
estadd scalar exog2 = e(p_c)

treatreg PostElViolence SeriousFraud  `controls' 			, treat(NegReport =  previolev) cluster(cowcode) 
est store TableA18m5
estadd scalar exog2 = e(p_c)

estout TableA18m* using AppendixTableA18.tex, ///
	replace style(tex) eqlabels(none)  label cells(b(fmt(%9.3f) star) ///
	se(par fmt(%9.3f))) stats(exog2 N N_clust aic bic ll, fmt(2 0 0 2 2 2) ///
	label("p(exogeneity)" "Observations" "Number of countries"  "AIC" "BIC" "LL")) ///
	starlevels(* .1 ** .05 *** .01) ///
	order (NegReport SeriousFraud LoserVoteShare Boycott type3 previolev ///
	DPI_yrsoffc_Lag1Log Prio_CWPast10 WB_GDPpc_Lag1Log Ross_oilgas_valuePOP2000_Lag1Log ///
	P_xconst_Lag1 WB_PopM_Lag1Log Finkel_EF_Lag1 ///
	Kelley_QED_SR11CHEAT Kelley_QED_SR21CHEAT Kelley_QED_SR22CAP ///
	WB_ODAPCconstant_Lag1Log FirstMultiParty Lindberg_Turnover Kelley_QED_SELTRANS ///
	IncLost OppoCoalition exclpop_Lag1) 

	
	
***********************************
* Appendix Table A19
***********************************
use "Condemnation.dta", clear
		
set more off
local controls LoserVoteShare Boycott type3 previolev DPI_yrsoffc_Lag1Log ///
	Prio_CWPast10 WB_GDPpc_Lag1Log  Ross_oilgas_valuePOP2000_Lag1Log ///
	P_xconst_Lag1 WB_PopM_Lag1Log Finkel_EF_Lag1 ///
	agree2un_Lag1 BritFrColony ODAperGDP_Lag1 

logit PostElViolence NegReport SeriousFraud  			observedW46 `controls' , vce (cluster cowcode)  	 	asis
est store TableA19m1
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit PostElViolence NegReport Kelley_SeriousFraudorig  observedW46 `controls' , vce (cluster cowcode)  asis	 	
est store TableA19m2
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit PostElViolence NegReport Kelley_QED_SR21CHEAT   	observedW46 `controls' , vce (cluster cowcode)  asis	 	
est store TableA19m3
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit PostElViolence NegReport SeriousFraud  			`controls' if observedW46 ==1, vce (cluster cowcode) asis	 	
est store TableA19m4
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit PostElViolence NegReport Kelley_SeriousFraudorig   `controls' if observedW46 ==1, vce (cluster cowcode) asis	 	
est store TableA19m5
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)

logit PostElViolence NegReport Kelley_QED_SR21CHEAT   	`controls' if observedW46 ==1,vce (cluster cowcode) asis	  	
est store TableA19m6
estadd scalar R2 = e(r2_p)
lroc, nograph
estadd scalar lroc = r(area)
estat class
estadd scalar class = r(P_corr)
	
estout TableA19m* using AppendixTableA19.tex, ///
	replace style(tex) eqlabels(none)  label cells(b(fmt(%9.3f) star) ///
	se(par fmt(%9.3f))) stats(N N_clust class lroc R2 aic bic ll, fmt(0 0 2 2 2) ///
	label( "Observations" "Number of countries"  "Percent correctly classified" "ROC" "Pseudo R2" "AIC" "BIC" "LL")) ///
	starlevels(* .1 ** .05 *** .01) ///
	order (NegReport observedW46 ///
	SeriousFraud Kelley_SeriousFraudorig Kelley_QED_SR21CHEAT) 


	
***********************************
* Appendix Table A20
***********************************
use "Condemnation.dta", clear

set more off
local controls LoserVoteShare Boycott type3 previolev DPI_yrsoffc_Lag1Log ///
	Prio_CWPast10 WB_GDPpc_Lag1Log  Ross_oilgas_valuePOP2000_Lag1Log ///
	P_xconst_Lag1 WB_PopM_Lag1Log Finkel_EF_Lag1 ///
	FirstRepMon

logit PostElViolence NegReport SeriousFraud  				observedW46 `controls' , vce (cluster cowcode)  	 	
est store TableA20m1
logit   PostElViolence NegReport Kelley_SeriousFraudorig   	observedW46 `controls' , vce (cluster cowcode)  	   
est store TableA20m2
logit   PostElViolence NegReport Kelley_QED_SR21CHEAT   	observedW46 `controls' , vce (cluster cowcode)  	 	  
est store TableA20m3
logit   PostElViolence NegReport SeriousFraud  				`controls' if observedW46 ==1, vce (cluster cowcode) 	 	
est store TableA20m4
logit   PostElViolence NegReport Kelley_SeriousFraudorig   	`controls' if observedW46 ==1, vce (cluster cowcode) 	   	
est store TableA20m5
logit  PostElViolence NegReport Kelley_QED_SR21CHEAT   		`controls' if observedW46 ==1,vce (cluster cowcode) 	    	
est store TableA20m6

estout TableA20m* using AppendixTableA20.tex, ///
	replace style(tex) eqlabels(none)  label cells(b(fmt(%9.3f) star) ///
	se(par fmt(%9.3f))) stats(N N_clust aic bic ll, fmt(0 0 2 2 2) ///
	label( "Observations" "Number of countries" "AIC" "BIC" "LL")) ///
	starlevels(* .1 ** .05 *** .01) ///
	order (NegReport FirstRepMon observedW46 ///
	SeriousFraud Kelley_SeriousFraudorig Kelley_QED_SR21CHEAT) 

	
		
***********************************
* Appendix Table A21
***********************************
use "Condemnation.dta", clear
	
set more off
local controls LoserVoteShare Boycott type3 previolev DPI_yrsoffc_Lag1Log ///
	Prio_CWPast10 WB_GDPpc_Lag1Log  Ross_oilgas_valuePOP2000_Lag1Log ///
	P_xconst_Lag1 WB_PopM_Lag1Log Finkel_EF_Lag1 ///
	DomesticMon

logit PostElViolence NegReport SeriousFraud  				observedW46 `controls' , vce (cluster cowcode)  	 	
est store TableA21m1
logit   PostElViolence NegReport Kelley_SeriousFraudorig   	observedW46 `controls' , vce (cluster cowcode)  	   
est store TableA21m2
logit   PostElViolence NegReport Kelley_QED_SR21CHEAT   	observedW46 `controls' , vce (cluster cowcode)  	 	  
est store TableA21m3
logit   PostElViolence NegReport SeriousFraud  				`controls' if observedW46 ==1, vce (cluster cowcode) 	 	
est store TableA21m4
logit   PostElViolence NegReport Kelley_SeriousFraudorig   	`controls' if observedW46 ==1, vce (cluster cowcode) 	   	
est store TableA21m5
logit  PostElViolence NegReport Kelley_QED_SR21CHEAT   		`controls' if observedW46 ==1,vce (cluster cowcode) 	    	
est store TableA21m6

estout TableA21m* using AppendixTableA21.tex, ///
	replace style(tex) eqlabels(none)  label cells(b(fmt(%9.3f) star) ///
	se(par fmt(%9.3f))) stats(N N_clust aic bic ll, fmt(0 0 2 2 2) ///
	label( "Observations" "Number of countries" "AIC" "BIC" "LL")) ///
	starlevels(* .1 ** .05 *** .01) ///
	order (NegReport DomesticMon observedW46 ///
	SeriousFraud Kelley_SeriousFraudorig Kelley_QED_SR21CHEAT) 

	
	
***********************************
* Appendix Table A22
***********************************
use "Condemnation.dta", clear
	
set more off
local controls LoserVoteShare Boycott type3 previolev DPI_yrsoffc_Lag1Log ///
	Prio_CWPast10 WB_GDPpc_Lag1Log  Ross_oilgas_valuePOP2000_Lag1Log ///
	P_xconst_Lag1 WB_PopM_Lag1Log Finkel_EF_Lag1 
 
logit PostElViolence NegReportReached SeriousFraud  				observedW46 `controls' , vce (cluster cowcode)  	 	
est store TableA22m1
logit   PostElViolence NegReportReached Kelley_SeriousFraudorig   	observedW46 `controls' , vce (cluster cowcode)  	   
est store TableA22m2
logit   PostElViolence NegReportReached Kelley_QED_SR21CHEAT   		observedW46 `controls' , vce (cluster cowcode)  	 	  
est store TableA22m3
logit   PostElViolence NegReportReached SeriousFraud  				`controls' if observedW46 ==1, vce (cluster cowcode) 	 	
est store TableA22m4
logit   PostElViolence NegReportReached Kelley_SeriousFraudorig   	`controls' if observedW46 ==1, vce (cluster cowcode) 	   	
est store TableA22m5
logit  PostElViolence NegReportReached Kelley_QED_SR21CHEAT   		`controls' if observedW46 ==1,vce (cluster cowcode) 	    	
est store TableA22m6

estout TableA22m* using AppendixTableA22.tex, ///
	replace style(tex) eqlabels(none)  label cells(b(fmt(%9.3f) star) ///
	se(par fmt(%9.3f))) stats(N N_clust aic bic ll, fmt(0 0 2 2 2) ///
	label( "Observations" "Number of countries" "AIC" "BIC" "LL")) ///
	starlevels(* .1 ** .05 *** .01) ///
	order (NegReportReached  observedW46 ///
	SeriousFraud Kelley_SeriousFraudorig Kelley_QED_SR21CHEAT) 

	
	
***********************************
* Appendix Figure A4 - see R code
***********************************
	
	
	
***********************************
* Appendix Table A23
***********************************
use "Condemnation.dta", clear

keep COUNTRY_NAME year ///
	observedW46 SeriousFraud Boycott type3 previolev LoserVoteShare ///
	DPI_yrsoffc_Lag1Log Prio_CWPast10 WB_GDPpc_Lag1Log  ///
	Ross_oilgas_valuePOP2000_Lag1Log P_xconst_Lag1 WB_PopM_Lag1Log Finkel_EF_Lag1 
keep if COUNTRY_NAME=="SIERRALEONE" & year==2007 | ///
	COUNTRY_NAME=="KENYA" & year==2007
	
* exponentiate logged variables
gen DPI_yrsoffc_Lag1=exp(DPI_yrsoffc_Lag1Log)
gen WB_GDPpc_Lag1=exp(WB_GDPpc_Lag1Log)
gen Ross_oilgas_valuePOP2000_Lag1=exp(Ross_oilgas_valuePOP2000_Lag1Log)
gen WB_PopM_Lag1=exp(WB_PopM_Lag1Log)

keep COUNTRY_NAME year ///
	observedW46 SeriousFraud Boycott type3 previolev LoserVoteShare ///
	DPI_yrsoffc_Lag1 Prio_CWPast10 WB_GDPpc_Lag1  ///
	Ross_oilgas_valuePOP2000_Lag1 P_xconst_Lag1 WB_PopM_Lag1 Finkel_EF_Lag1 
order COUNTRY_NAME year ///
	observedW46 SeriousFraud Boycott type3 previolev LoserVoteShare ///
	DPI_yrsoffc_Lag1 Prio_CWPast10 WB_GDPpc_Lag1  ///
	Ross_oilgas_valuePOP2000_Lag1 P_xconst_Lag1 WB_PopM_Lag1 Finkel_EF_Lag1 

rename observedW46 IO_observers_present  
rename type3 Poll_type
rename previolev Pre_election_violence  
rename DPI_yrsoffc_Lag1 Leader_tenure_in_years 
rename Prio_CWPast10 Post_conflict
rename WB_GDPpc_Lag1   GDP_pc_in_USD
rename Ross_oilgas_valuePOP2000_Lag1 Natural_resources 
rename P_xconst_Lag1 Executive_constraints
rename WB_PopM_Lag1 Population_size

replace  GDP_pc_in_USD=int(GDP_pc_in_USD)
replace  Natural_resources=int(Natural_resources)
replace  Population_size=int(Population_size)
replace  LoserVoteShare=int(LoserVoteShare)

gen EF = string(Finkel_EF_Lag1, "%3.2f") 
destring EF, gen (Ethnic_fractionalization)
drop Finkel_EF_Lag1 EF

xpose, clear varname
order _varname v2 v1
rename _varname variable
drop if v2==. | v2==2007
rename v2 Kenya
rename v1 SierraLeone

texsave variable Kenya SierraLeone using AppendixTableA23.tex , replace varlabels 


